+2005-07-05 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtkmenu.c (gtk_menu_grab_notify): Take window
+ groups into account. (#309473, Diego Gonzalez)
+
+ * gtk/gtkwindow.[hc]: Add a non-exported function to
+ get the grab widget of a window group.
+
2005-07-05 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeview.c (gtk_tree_view_bin_expose): in the
+2005-07-05 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtkmenu.c (gtk_menu_grab_notify): Take window
+ groups into account. (#309473, Diego Gonzalez)
+
+ * gtk/gtkwindow.[hc]: Add a non-exported function to
+ get the grab widget of a window group.
+
2005-07-05 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeview.c (gtk_tree_view_bin_expose): in the
+2005-07-05 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtkmenu.c (gtk_menu_grab_notify): Take window
+ groups into account. (#309473, Diego Gonzalez)
+
+ * gtk/gtkwindow.[hc]: Add a non-exported function to
+ get the grab widget of a window group.
+
2005-07-05 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeview.c (gtk_tree_view_bin_expose): in the
<!-- ##### FUNCTION gtk_grab_get_current ##### -->
<para>
-Queries the current grab.
+Queries the current grab of the default window group.
</para>
@Returns: The widget which currently has the grab or %NULL if no grab is active.
/**
* gtk_menu_get_for_attach_widget:
* @widget: a #GtkWidget
- *
- * Returns a list of the menus which are attached to this widget.
+ * * Returns a list of the menus which are attached to this widget.
* This list is owned by GTK+ and must not be modified.
*
* Return value: the list of menus attached to his widget.
gtk_menu_grab_notify (GtkWidget *widget,
gboolean was_grabbed)
{
+ GtkWidget *toplevel;
+ GtkWindowGroup *group;
+ GtkWidget *grab;
+
+ toplevel = gtk_widget_get_toplevel (widget);
+ group = _gtk_window_get_group (GTK_WINDOW (toplevel));
+ grab = _gtk_window_group_get_current_grab (group);
+
if (!was_grabbed)
{
- if (!GTK_IS_MENU (gtk_grab_get_current ()))
- gtk_menu_shell_cancel (GTK_MENU_SHELL (widget));
+ if (!GTK_IS_MENU_SHELL (grab))
+ gtk_menu_shell_cancel (GTK_MENU_SHELL (widget));
}
}
}
}
+/* Return the current grab widget of the given group
+ */
+GtkWidget *
+_gtk_window_group_get_current_grab (GtkWindowGroup *window_group)
+{
+ if (window_group->grabs)
+ return GTK_WIDGET (window_group->grabs->data);
+ return NULL;
+}
/*
Derived from XParseGeometry() in XFree86
gint *new_width,
gint *new_height);
GtkWindowGroup *_gtk_window_get_group (GtkWindow *window);
+GtkWidget *_gtk_window_group_get_current_grab (GtkWindowGroup *window_group);
void _gtk_window_set_has_toplevel_focus (GtkWindow *window,
gboolean has_toplevel_focus);